import https from "@/utils/http/http2";

export const getDepartmentInfo = params => {
  return https({
    method: "get",
    url: "/department",
    params
  });
};
export const getAllDepartmentInfo = () => {
  return https({
    method: "get",
    url: "/department/all"
  });
};
export const delDepartmentInfo = id => {
  return https({
    method: "DELETE",
    url: `/department/${id}`
  });
};
export const addDepartmentInfo = data => {
  return https({
    method: "post",
    url: `/department`,
    data
  });
};

export const upDataDepartmentInfo = data => {
  return https({
    method: "put",
    url: `/department`,
    data
  });
};
// 角色
export const getRoleInfo = params => {
  return https({
    method: "get",
    url: "/role",
    params
  });
};
export const getAllRoleInfo = () => {
  return https({
    method: "get",
    url: "/role/all"
  });
};
export const addRoleInfo = data => {
  return https({
    method: "post",
    url: `/role`,
    data
  });
};

export const delRoleInfo = id => {
  return https({
    method: "DELETE",
    url: `/role/${id}`
  });
};
// employee
// 员工
export const getEmployeeInfo = params => {
  return https({
    method: "get",
    url: "/employee",
    params
  });
};
export const delEmployeeInfo = id => {
  return https({
    method: "DELETE",
    url: `/employee/${id}`
  });
};
export const addEmployeeInfo = data => {
  return https({
    method: "post",
    url: `/employee`,
    data
  });
};

export const upDataEmployeeInfo = data => {
  return https({
    method: "put",
    url: `/employee`,
    data
  });
};
/**
 * 根据员工类型查询员工
 * @param type
 * @returns
 */
export const getEmployeeInfoByType = type => {
  return https({
    method: "get",
    url: `/employee/${type}`
  });
};
